<!doctype html>
<html>
<head>
<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>

<link href='https://fonts.loli.net/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext' rel='stylesheet' type='text/css' /><style type='text/css'>html {overflow-x: initial !important;}:root { --bg-color:#ffffff; --text-color:#333333; --select-text-bg-color:#B5D6FC; --select-text-font-color:auto; --monospace:"Lucida Console",Consolas,"Courier",monospace; --title-bar-height:20px; }
.mac-os-11 { --title-bar-height:28px; }
html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { margin: 0px; padding: 0px; height: auto; bottom: 0px; top: 0px; left: 0px; right: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; tab-size: 4; }
iframe { margin: auto; }
a.url { word-break: break-all; }
a:active, a:hover { outline: 0px; }
.in-text-selection, ::selection { text-shadow: none; background: var(--select-text-bg-color); color: var(--select-text-font-color); }
#write { margin: 0px auto; height: auto; width: inherit; word-break: normal; overflow-wrap: break-word; position: relative; white-space: normal; overflow-x: visible; padding-top: 36px; }
#write.first-line-indent p { text-indent: 2em; }
#write.first-line-indent li p, #write.first-line-indent p * { text-indent: 0px; }
#write.first-line-indent li { margin-left: 2em; }
.for-image #write { padding-left: 8px; padding-right: 8px; }
body.typora-export { padding-left: 30px; padding-right: 30px; }
.typora-export .footnote-line, .typora-export li, .typora-export p { white-space: pre-wrap; }
.typora-export .task-list-item input { pointer-events: none; }
@media screen and (max-width: 500px) {
  body.typora-export { padding-left: 0px; padding-right: 0px; }
  #write { padding-left: 20px; padding-right: 20px; }
  .CodeMirror-sizer { margin-left: 0px !important; }
  .CodeMirror-gutters { display: none !important; }
}
#write li > figure:last-child { margin-bottom: 0.5rem; }
#write ol, #write ul { position: relative; }
img { max-width: 100%; vertical-align: middle; image-orientation: from-image; }
button, input, select, textarea { color: inherit; font: inherit; }
input[type="checkbox"], input[type="radio"] { line-height: normal; padding: 0px; }
*, ::after, ::before { box-sizing: border-box; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p, #write pre { width: inherit; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p { position: relative; }
p { line-height: inherit; }
h1, h2, h3, h4, h5, h6 { break-after: avoid-page; break-inside: avoid; orphans: 4; }
p { orphans: 4; }
h1 { font-size: 2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.4rem; }
h5 { font-size: 1.2rem; }
h6 { font-size: 1rem; }
.md-math-block, .md-rawblock, h1, h2, h3, h4, h5, h6, p { margin-top: 1rem; margin-bottom: 1rem; }
.hidden { display: none; }
.md-blockmeta { color: rgb(204, 204, 204); font-weight: 700; font-style: italic; }
a { cursor: pointer; }
sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-radius: 4px; cursor: pointer; }
sup.md-footnote a, sup.md-footnote a:hover { color: inherit; text-transform: inherit; text-decoration: inherit; }
#write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; }
figure { overflow-x: auto; margin: 1.2em 0px; max-width: calc(100% + 16px); padding: 0px; }
figure > table { margin: 0px; }
tr { break-inside: avoid; break-after: auto; }
thead { display: table-header-group; }
table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }
table.md-table td { min-width: 32px; }
.CodeMirror-gutters { border-right: 0px; background-color: inherit; }
.CodeMirror-linenumber { user-select: none; }
.CodeMirror { text-align: left; }
.CodeMirror-placeholder { opacity: 0.3; }
.CodeMirror pre { padding: 0px 4px; }
.CodeMirror-lines { padding: 0px; }
div.hr:focus { cursor: none; }
#write pre { white-space: pre-wrap; }
#write.fences-no-line-wrapping pre { white-space: pre; }
#write pre.ty-contain-cm { white-space: normal; }
.CodeMirror-gutters { margin-right: 4px; }
.md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; background: inherit; position: relative !important; }
.md-fences-adv-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }
#write .md-fences.mock-cm { white-space: pre-wrap; }
.md-fences.md-fences-with-lineno { padding-left: 0px; }
#write.fences-no-line-wrapping .md-fences.mock-cm { white-space: pre; overflow-x: auto; }
.md-fences.mock-cm.md-fences-with-lineno { padding-left: 8px; }
.CodeMirror-line, twitterwidget { break-inside: avoid; }
.footnotes { opacity: 0.8; font-size: 0.9rem; margin-top: 1em; margin-bottom: 1em; }
.footnotes + .footnotes { margin-top: 0px; }
.md-reset { margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: top; background: 0px 0px; text-decoration: none; text-shadow: none; float: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; -webkit-tap-highlight-color: transparent; line-height: normal; font-weight: 400; text-align: left; box-sizing: content-box; direction: ltr; }
li div { padding-top: 0px; }
blockquote { margin: 1rem 0px; }
li .mathjax-block, li p { margin: 0.5rem 0px; }
li blockquote { margin: 1rem 0px; }
li { margin: 0px; position: relative; }
blockquote > :last-child { margin-bottom: 0px; }
blockquote > :first-child, li > :first-child { margin-top: 0px; }
.footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; white-space: normal; }
#write .footnote-line { white-space: pre-wrap; }
@media print {
  body, html { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; font-variant-ligatures: no-common-ligatures; }
  #write { margin-top: 0px; padding-top: 0px; border-color: transparent !important; }
  .typora-export * { -webkit-print-color-adjust: exact; }
  .typora-export #write { break-after: avoid; }
  .typora-export #write::after { height: 0px; }
  .is-mac table { break-inside: avoid; }
  .typora-export-show-outline .typora-export-sidebar { display: none; }
}
.footnote-line { margin-top: 0.714em; font-size: 0.7em; }
a img, img a { cursor: pointer; }
pre.md-meta-block { font-size: 0.8rem; min-height: 0.8rem; white-space: pre-wrap; background: rgb(204, 204, 204); display: block; overflow-x: hidden; }
p > .md-image:only-child:not(.md-img-error) img, p > img:only-child { display: block; margin: auto; }
#write.first-line-indent p > .md-image:only-child:not(.md-img-error) img { left: -2em; position: relative; }
p > .md-image:only-child { display: inline-block; width: 100%; }
#write .MathJax_Display { margin: 0.8em 0px 0px; }
.md-math-block { width: 100%; }
.md-math-block:not(:empty)::after { display: none; }
.MathJax_ref { fill: currentcolor; }
[contenteditable="true"]:active, [contenteditable="true"]:focus, [contenteditable="false"]:active, [contenteditable="false"]:focus { outline: 0px; box-shadow: none; }
.md-task-list-item { position: relative; list-style-type: none; }
.task-list-item.md-task-list-item { padding-left: 0px; }
.md-task-list-item > input { position: absolute; top: 0px; left: 0px; margin-left: -1.2em; margin-top: calc(1em - 10px); border: none; }
.math { font-size: 1rem; }
.md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-radius: 10px; }
.md-toc-content { position: relative; margin-left: 0px; }
.md-toc-content::after, .md-toc::after { display: none; }
.md-toc-item { display: block; color: rgb(65, 131, 196); }
.md-toc-item a { text-decoration: none; }
.md-toc-inner:hover { text-decoration: underline; }
.md-toc-inner { display: inline-block; cursor: pointer; }
.md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: 700; }
.md-toc-h2 .md-toc-inner { margin-left: 2em; }
.md-toc-h3 .md-toc-inner { margin-left: 4em; }
.md-toc-h4 .md-toc-inner { margin-left: 6em; }
.md-toc-h5 .md-toc-inner { margin-left: 8em; }
.md-toc-h6 .md-toc-inner { margin-left: 10em; }
@media screen and (max-width: 48em) {
  .md-toc-h3 .md-toc-inner { margin-left: 3.5em; }
  .md-toc-h4 .md-toc-inner { margin-left: 5em; }
  .md-toc-h5 .md-toc-inner { margin-left: 6.5em; }
  .md-toc-h6 .md-toc-inner { margin-left: 8em; }
}
a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }
.footnote-line a:not(.reversefootnote) { color: inherit; }
.md-attr { display: none; }
.md-fn-count::after { content: "."; }
code, pre, samp, tt { font-family: var(--monospace); }
kbd { margin: 0px 0.1em; padding: 0.1em 0.6em; font-size: 0.8em; color: rgb(36, 39, 41); background: rgb(255, 255, 255); border: 1px solid rgb(173, 179, 185); border-radius: 3px; box-shadow: rgba(12, 13, 14, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset; white-space: nowrap; vertical-align: middle; }
.md-comment { color: rgb(162, 127, 3); opacity: 0.8; font-family: var(--monospace); }
code { text-align: left; vertical-align: initial; }
a.md-print-anchor { white-space: pre !important; border-width: initial !important; border-style: none !important; border-color: initial !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: 0px !important; background: 0px 0px !important; text-decoration: initial !important; text-shadow: initial !important; }
.md-inline-math .MathJax_SVG .noError { display: none !important; }
.html-for-mac .inline-math-svg .MathJax_SVG { vertical-align: 0.2px; }
.md-fences-math .MathJax_SVG_Display, .md-math-block .MathJax_SVG_Display { text-align: center; margin: 0px; position: relative; text-indent: 0px; max-width: none; max-height: none; min-height: 0px; min-width: 100%; width: auto; overflow-y: visible; display: block !important; }
.MathJax_SVG_Display, .md-inline-math .MathJax_SVG_Display { width: auto; margin: inherit; display: inline-block !important; }
.MathJax_SVG .MJX-monospace { font-family: var(--monospace); }
.MathJax_SVG .MJX-sans-serif { font-family: sans-serif; }
.MathJax_SVG { display: inline; font-style: normal; font-weight: 400; line-height: normal; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; zoom: 90%; }
#math-inline-preview-content { zoom: 1.1; }
.MathJax_SVG * { transition: none 0s ease 0s; }
.MathJax_SVG_Display svg { vertical-align: middle !important; margin-bottom: 0px !important; margin-top: 0px !important; }
.os-windows.monocolor-emoji .md-emoji { font-family: "Segoe UI Symbol", sans-serif; }
.md-diagram-panel > svg { max-width: 100%; }
[lang="flow"] svg, [lang="mermaid"] svg { max-width: 100%; height: auto; }
[lang="mermaid"] .node text { font-size: 1rem; }
table tr th { border-bottom: 0px; }
video { max-width: 100%; display: block; margin: 0px auto; }
iframe { max-width: 100%; width: 100%; border: none; }
.highlight td, .highlight tr { border: 0px; }
mark { background: rgb(255, 255, 0); color: rgb(0, 0, 0); }
.md-html-inline .md-plain, .md-html-inline strong, mark .md-inline-math, mark strong { color: inherit; }
.md-expand mark .md-meta { opacity: 0.3 !important; }
mark .md-meta { color: rgb(0, 0, 0); }
@media print {
  .typora-export h1, .typora-export h2, .typora-export h3, .typora-export h4, .typora-export h5, .typora-export h6 { break-inside: avoid; }
}
.md-diagram-panel .messageText { stroke: none !important; }
.md-diagram-panel .start-state { fill: var(--node-fill); }
.md-diagram-panel .edgeLabel rect { opacity: 1 !important; }
.md-require-zoom-fix foreignobject { font-size: var(--mermaid-font-zoom); }
.md-fences.md-fences-math { font-size: 1em; }
.md-fences-math .MathJax_SVG_Display { margin-top: 8px; cursor: default; }
.md-fences-advanced:not(.md-focus) { padding: 0px; white-space: nowrap; border: 0px; }
.md-fences-advanced:not(.md-focus) { background: inherit; }
.typora-export-show-outline .typora-export-content { max-width: 1440px; margin: auto; display: flex; flex-direction: row; }
.typora-export-sidebar { width: 300px; font-size: 0.8rem; margin-top: 80px; margin-right: 18px; }
.typora-export-show-outline #write { --webkit-flex:2; flex: 2 1 0%; }
.typora-export-sidebar .outline-content { position: fixed; top: 0px; max-height: 100%; overflow: hidden auto; padding-bottom: 30px; padding-top: 60px; width: 300px; }
@media screen and (max-width: 1024px) {
  .typora-export-sidebar, .typora-export-sidebar .outline-content { width: 240px; }
}
@media screen and (max-width: 800px) {
  .typora-export-sidebar { display: none; }
}
.outline-content li, .outline-content ul { margin-left: 0px; margin-right: 0px; padding-left: 0px; padding-right: 0px; list-style: none; }
.outline-content ul { margin-top: 0px; margin-bottom: 0px; }
.outline-content strong { font-weight: 400; }
.outline-expander { width: 1rem; height: 1.42857rem; position: relative; display: table-cell; vertical-align: middle; cursor: pointer; padding-left: 4px; }
.outline-expander::before { content: ""; position: relative; font-family: Ionicons; display: inline-block; font-size: 8px; vertical-align: middle; }
.outline-item { padding-top: 3px; padding-bottom: 3px; cursor: pointer; }
.outline-expander:hover::before { content: ""; }
.outline-h1 > .outline-item { padding-left: 0px; }
.outline-h2 > .outline-item { padding-left: 1em; }
.outline-h3 > .outline-item { padding-left: 2em; }
.outline-h4 > .outline-item { padding-left: 3em; }
.outline-h5 > .outline-item { padding-left: 4em; }
.outline-h6 > .outline-item { padding-left: 5em; }
.outline-label { cursor: pointer; display: table-cell; vertical-align: middle; text-decoration: none; color: inherit; }
.outline-label:hover { text-decoration: underline; }
.outline-item:hover { border-color: rgb(245, 245, 245); background-color: var(--item-hover-bg-color); }
.outline-item:hover { margin-left: -28px; margin-right: -28px; border-left: 28px solid transparent; border-right: 28px solid transparent; }
.outline-item-single .outline-expander::before, .outline-item-single .outline-expander:hover::before { display: none; }
.outline-item-open > .outline-item > .outline-expander::before { content: ""; }
.outline-children { display: none; }
.info-panel-tab-wrapper { display: none; }
.outline-item-open > .outline-children { display: block; }
.typora-export .outline-item { padding-top: 1px; padding-bottom: 1px; }
.typora-export .outline-item:hover { margin-right: -8px; border-right: 8px solid transparent; }
.typora-export .outline-expander::before { content: "+"; font-family: inherit; top: -1px; }
.typora-export .outline-expander:hover::before, .typora-export .outline-item-open > .outline-item > .outline-expander::before { content: "−"; }
.typora-export-collapse-outline .outline-children { display: none; }
.typora-export-collapse-outline .outline-item-open > .outline-children, .typora-export-no-collapse-outline .outline-children { display: block; }
.typora-export-no-collapse-outline .outline-expander::before { content: "" !important; }
.typora-export-show-outline .outline-item-active > .outline-item .outline-label { font-weight: 700; }


.CodeMirror { height: auto; }
.CodeMirror.cm-s-inner { background: inherit; }
.CodeMirror-scroll { overflow: auto hidden; z-index: 3; }
.CodeMirror-gutter-filler, .CodeMirror-scrollbar-filler { background-color: rgb(255, 255, 255); }
.CodeMirror-gutters { border-right: 1px solid rgb(221, 221, 221); background: inherit; white-space: nowrap; }
.CodeMirror-linenumber { padding: 0px 3px 0px 5px; text-align: right; color: rgb(153, 153, 153); }
.cm-s-inner .cm-keyword { color: rgb(119, 0, 136); }
.cm-s-inner .cm-atom, .cm-s-inner.cm-atom { color: rgb(34, 17, 153); }
.cm-s-inner .cm-number { color: rgb(17, 102, 68); }
.cm-s-inner .cm-def { color: rgb(0, 0, 255); }
.cm-s-inner .cm-variable { color: rgb(0, 0, 0); }
.cm-s-inner .cm-variable-2 { color: rgb(0, 85, 170); }
.cm-s-inner .cm-variable-3 { color: rgb(0, 136, 85); }
.cm-s-inner .cm-string { color: rgb(170, 17, 17); }
.cm-s-inner .cm-property { color: rgb(0, 0, 0); }
.cm-s-inner .cm-operator { color: rgb(152, 26, 26); }
.cm-s-inner .cm-comment, .cm-s-inner.cm-comment { color: rgb(170, 85, 0); }
.cm-s-inner .cm-string-2 { color: rgb(255, 85, 0); }
.cm-s-inner .cm-meta { color: rgb(85, 85, 85); }
.cm-s-inner .cm-qualifier { color: rgb(85, 85, 85); }
.cm-s-inner .cm-builtin { color: rgb(51, 0, 170); }
.cm-s-inner .cm-bracket { color: rgb(153, 153, 119); }
.cm-s-inner .cm-tag { color: rgb(17, 119, 0); }
.cm-s-inner .cm-attribute { color: rgb(0, 0, 204); }
.cm-s-inner .cm-header, .cm-s-inner.cm-header { color: rgb(0, 0, 255); }
.cm-s-inner .cm-quote, .cm-s-inner.cm-quote { color: rgb(0, 153, 0); }
.cm-s-inner .cm-hr, .cm-s-inner.cm-hr { color: rgb(153, 153, 153); }
.cm-s-inner .cm-link, .cm-s-inner.cm-link { color: rgb(0, 0, 204); }
.cm-negative { color: rgb(221, 68, 68); }
.cm-positive { color: rgb(34, 153, 34); }
.cm-header, .cm-strong { font-weight: 700; }
.cm-del { text-decoration: line-through; }
.cm-em { font-style: italic; }
.cm-link { text-decoration: underline; }
.cm-error { color: red; }
.cm-invalidchar { color: red; }
.cm-constant { color: rgb(38, 139, 210); }
.cm-defined { color: rgb(181, 137, 0); }
div.CodeMirror span.CodeMirror-matchingbracket { color: rgb(0, 255, 0); }
div.CodeMirror span.CodeMirror-nonmatchingbracket { color: rgb(255, 34, 34); }
.cm-s-inner .CodeMirror-activeline-background { background: inherit; }
.CodeMirror { position: relative; overflow: hidden; }
.CodeMirror-scroll { height: 100%; outline: 0px; position: relative; box-sizing: content-box; background: inherit; }
.CodeMirror-sizer { position: relative; }
.CodeMirror-gutter-filler, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-vscrollbar { position: absolute; z-index: 6; display: none; }
.CodeMirror-vscrollbar { right: 0px; top: 0px; overflow: hidden; }
.CodeMirror-hscrollbar { bottom: 0px; left: 0px; overflow: hidden; }
.CodeMirror-scrollbar-filler { right: 0px; bottom: 0px; }
.CodeMirror-gutter-filler { left: 0px; bottom: 0px; }
.CodeMirror-gutters { position: absolute; left: 0px; top: 0px; padding-bottom: 30px; z-index: 3; }
.CodeMirror-gutter { white-space: normal; height: 100%; box-sizing: content-box; padding-bottom: 30px; margin-bottom: -32px; display: inline-block; }
.CodeMirror-gutter-wrapper { position: absolute; z-index: 4; background: 0px 0px !important; border: none !important; }
.CodeMirror-gutter-background { position: absolute; top: 0px; bottom: 0px; z-index: 4; }
.CodeMirror-gutter-elt { position: absolute; cursor: default; z-index: 4; }
.CodeMirror-lines { cursor: text; }
.CodeMirror pre { border-radius: 0px; border-width: 0px; background: 0px 0px; font-family: inherit; font-size: inherit; margin: 0px; white-space: pre; overflow-wrap: normal; color: inherit; z-index: 2; position: relative; overflow: visible; }
.CodeMirror-wrap pre { overflow-wrap: break-word; white-space: pre-wrap; word-break: normal; }
.CodeMirror-code pre { border-right: 30px solid transparent; width: fit-content; }
.CodeMirror-wrap .CodeMirror-code pre { border-right: none; width: auto; }
.CodeMirror-linebackground { position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px; z-index: 0; }
.CodeMirror-linewidget { position: relative; z-index: 2; overflow: auto; }
.CodeMirror-wrap .CodeMirror-scroll { overflow-x: hidden; }
.CodeMirror-measure { position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden; }
.CodeMirror-measure pre { position: static; }
.CodeMirror div.CodeMirror-cursor { position: absolute; visibility: hidden; border-right: none; width: 0px; }
.CodeMirror div.CodeMirror-cursor { visibility: hidden; }
.CodeMirror-focused div.CodeMirror-cursor { visibility: inherit; }
.cm-searching { background: rgba(255, 255, 0, 0.4); }
span.cm-underlined { text-decoration: underline; }
span.cm-strikethrough { text-decoration: line-through; }
.cm-tw-syntaxerror { color: rgb(255, 255, 255); background-color: rgb(153, 0, 0); }
.cm-tw-deleted { text-decoration: line-through; }
.cm-tw-header5 { font-weight: 700; }
.cm-tw-listitem:first-child { padding-left: 10px; }
.cm-tw-box { border-style: solid; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-color: inherit; border-top-width: 0px !important; }
.cm-tw-underline { text-decoration: underline; }
@media print {
  .CodeMirror div.CodeMirror-cursor { visibility: hidden; }
}


:root {
    --side-bar-bg-color: #fafafa;
    --control-text-color: #777;
}

@include-when-export url(https://fonts.loli.net/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext);

/* open-sans-regular - latin-ext_latin */
  /* open-sans-italic - latin-ext_latin */
    /* open-sans-700 - latin-ext_latin */
    /* open-sans-700italic - latin-ext_latin */
  html {
    font-size: 16px;
}

body {
    font-family: "Open Sans","Clear Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: rgb(51, 51, 51);
    line-height: 1.6;
}

#write {
    max-width: 860px;
  	margin: 0 auto;
  	padding: 30px;
    padding-bottom: 100px;
}

@media only screen and (min-width: 1400px) {
	#write {
		max-width: 1024px;
	}
}

@media only screen and (min-width: 1800px) {
	#write {
		max-width: 1200px;
	}
}

#write > ul:first-child,
#write > ol:first-child{
    margin-top: 30px;
}

a {
    color: #4183C4;
}
h1,
h2,
h3,
h4,
h5,
h6 {
    position: relative;
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-weight: bold;
    line-height: 1.4;
    cursor: text;
}
h1:hover a.anchor,
h2:hover a.anchor,
h3:hover a.anchor,
h4:hover a.anchor,
h5:hover a.anchor,
h6:hover a.anchor {
    text-decoration: none;
}
h1 tt,
h1 code {
    font-size: inherit;
}
h2 tt,
h2 code {
    font-size: inherit;
}
h3 tt,
h3 code {
    font-size: inherit;
}
h4 tt,
h4 code {
    font-size: inherit;
}
h5 tt,
h5 code {
    font-size: inherit;
}
h6 tt,
h6 code {
    font-size: inherit;
}
h1 {
    font-size: 2.25em;
    line-height: 1.2;
    border-bottom: 1px solid #eee;
}
h2 {
    font-size: 1.75em;
    line-height: 1.225;
    border-bottom: 1px solid #eee;
}

/*@media print {
    .typora-export h1,
    .typora-export h2 {
        border-bottom: none;
        padding-bottom: initial;
    }

    .typora-export h1::after,
    .typora-export h2::after {
        content: "";
        display: block;
        height: 100px;
        margin-top: -96px;
        border-top: 1px solid #eee;
    }
}*/

h3 {
    font-size: 1.5em;
    line-height: 1.43;
}
h4 {
    font-size: 1.25em;
}
h5 {
    font-size: 1em;
}
h6 {
   font-size: 1em;
    color: #777;
}
p,
blockquote,
ul,
ol,
dl,
table{
    margin: 0.8em 0;
}
li>ol,
li>ul {
    margin: 0 0;
}
hr {
    height: 2px;
    padding: 0;
    margin: 16px 0;
    background-color: #e7e7e7;
    border: 0 none;
    overflow: hidden;
    box-sizing: content-box;
}

li p.first {
    display: inline-block;
}
ul,
ol {
    padding-left: 30px;
}
ul:first-child,
ol:first-child {
    margin-top: 0;
}
ul:last-child,
ol:last-child {
    margin-bottom: 0;
}
blockquote {
    border-left: 4px solid #dfe2e5;
    padding: 0 15px;
    color: #777777;
}
blockquote blockquote {
    padding-right: 0;
}
table {
    padding: 0;
    word-break: initial;
}
table tr {
    border: 1px solid #dfe2e5;
    margin: 0;
    padding: 0;
}
table tr:nth-child(2n),
thead {
    background-color: #f8f8f8;
}
table th {
    font-weight: bold;
    border: 1px solid #dfe2e5;
    border-bottom: 0;
    margin: 0;
    padding: 6px 13px;
}
table td {
    border: 1px solid #dfe2e5;
    margin: 0;
    padding: 6px 13px;
}
table th:first-child,
table td:first-child {
    margin-top: 0;
}
table th:last-child,
table td:last-child {
    margin-bottom: 0;
}

.CodeMirror-lines {
    padding-left: 4px;
}

.code-tooltip {
    box-shadow: 0 1px 1px 0 rgba(0,28,36,.3);
    border-top: 1px solid #eef2f2;
}

.md-fences,
code,
tt {
    border: 1px solid #e7eaed;
    background-color: #f8f8f8;
    border-radius: 3px;
    padding: 0;
    padding: 2px 4px 0px 4px;
    font-size: 0.9em;
}

code {
    background-color: #f3f4f4;
    padding: 0 2px 0 2px;
}

.md-fences {
    margin-bottom: 15px;
    margin-top: 15px;
    padding-top: 8px;
    padding-bottom: 6px;
}


.md-task-list-item > input {
  margin-left: -1.3em;
}

@media print {
    html {
        font-size: 13px;
    }
    table,
    pre {
        page-break-inside: avoid;
    }
    pre {
        word-wrap: break-word;
    }
}

.md-fences {
	background-color: #f8f8f8;
}
#write pre.md-meta-block {
	padding: 1rem;
    font-size: 85%;
    line-height: 1.45;
    background-color: #f7f7f7;
    border: 0;
    border-radius: 3px;
    color: #777777;
    margin-top: 0 !important;
}

.mathjax-block>.code-tooltip {
	bottom: .375rem;
}

.md-mathjax-midline {
    background: #fafafa;
}

#write>h3.md-focus:before{
	left: -1.5625rem;
	top: .375rem;
}
#write>h4.md-focus:before{
	left: -1.5625rem;
	top: .285714286rem;
}
#write>h5.md-focus:before{
	left: -1.5625rem;
	top: .285714286rem;
}
#write>h6.md-focus:before{
	left: -1.5625rem;
	top: .285714286rem;
}
.md-image>.md-meta {
    /*border: 1px solid #ddd;*/
    border-radius: 3px;
    padding: 2px 0px 0px 4px;
    font-size: 0.9em;
    color: inherit;
}

.md-tag {
    color: #a7a7a7;
    opacity: 1;
}

.md-toc { 
    margin-top:20px;
    padding-bottom:20px;
}

.sidebar-tabs {
    border-bottom: none;
}

#typora-quick-open {
    border: 1px solid #ddd;
    background-color: #f8f8f8;
}

#typora-quick-open-item {
    background-color: #FAFAFA;
    border-color: #FEFEFE #e5e5e5 #e5e5e5 #eee;
    border-style: solid;
    border-width: 1px;
}

/** focus mode */
.on-focus-mode blockquote {
    border-left-color: rgba(85, 85, 85, 0.12);
}

header, .context-menu, .megamenu-content, footer{
    font-family: "Segoe UI", "Arial", sans-serif;
}

.file-node-content:hover .file-node-icon,
.file-node-content:hover .file-node-open-state{
    visibility: visible;
}

.mac-seamless-mode #typora-sidebar {
    background-color: #fafafa;
    background-color: var(--side-bar-bg-color);
}

.md-lang {
    color: #b4654d;
}

/*.html-for-mac {
    --item-hover-bg-color: #E6F0FE;
}*/

#md-notification .btn {
    border: 0;
}

.dropdown-menu .divider {
    border-color: #e5e5e5;
    opacity: 0.4;
}

.ty-preferences .window-content {
    background-color: #fafafa;
}

.ty-preferences .nav-group-item.active {
    color: white;
    background: #999;
}

.menu-item-container a.menu-style-btn {
    background-color: #f5f8fa;
    background-image: linear-gradient( 180deg , hsla(0, 0%, 100%, 0.8), hsla(0, 0%, 100%, 0)); 
}


 :root {--mermaid-font-zoom:1.25em ;} 
</style><title>Linux学习笔记</title>
</head>
<body class='typora-export os-windows typora-export-show-outline typora-export-no-collapse-outline'><div class='typora-export-content'>
<div class="typora-export-sidebar"><div class="outline-content"><li class="outline-item-wrapper outline-h1"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#linux学习笔记">Linux学习笔记</a></div><ul class="outline-children"><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#目录">目录</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#下载环境">下载环境</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#linux的目录结构">Linux的目录结构</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#远程连接">远程连接</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#linux系统管理">Linux系统管理</a></div><ul class="outline-children"><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#vi和vim">vi和vim</a></div><ul class="outline-children"><li class="outline-item-wrapper outline-h4"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#命令模式一般模式）">命令模式（一般模式）：</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h4"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#输入模式编辑模式）">输入模式（编辑模式）</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h4"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#底线命令模式命令行）">底线命令模式（命令行）</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h4"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#常用快捷键">常用快捷键</a></div><ul class="outline-children"></ul></li></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#linux用户管理">Linux用户管理</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#linux组管理">Linux组管理</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#linux系统操作">Linux系统操作</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#配置环境变量">配置环境变量</a></div><ul class="outline-children"></ul></li></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#linux操作命令">Linux操作命令</a></div><ul class="outline-children"><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#帮助命令">帮助命令</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#文件目录命令">文件目录命令</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#查找命令">查找命令</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#通配符">通配符</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#解压缩">解压缩</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#组管理">组管理</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#权限管理">权限管理</a></div><ul class="outline-children"><li class="outline-item-wrapper outline-h4"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#文件权限概述">文件权限概述</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h4"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#更改文件权限">更改文件权限</a></div><ul class="outline-children"></ul></li></ul></li></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#网络配置">网络配置</a></div><ul class="outline-children"><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#配置linux网络">配置Linux网络</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#防火墙管理">防火墙管理</a></div><ul class="outline-children"></ul></li></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#进程管理">进程管理</a></div><ul class="outline-children"><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#查看进程">查看进程</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#终止进程">终止进程</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#服务管理">服务管理</a></div><ul class="outline-children"><li class="outline-item-wrapper outline-h4"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#查看网路服务了解">查看网路服务(了解)</a></div><ul class="outline-children"></ul></li></ul></li></ul></li><li class="outline-item-wrapper outline-h2"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#linux软件包管理">Linux软件包管理</a></div><ul class="outline-children"><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#rpm">RPM</a></div><ul class="outline-children"></ul></li><li class="outline-item-wrapper outline-h3"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#yum">YUM</a></div><ul class="outline-children"><li class="outline-item-wrapper outline-h4"><div class="outline-item"><span class="outline-expander"></span><a class="outline-label" href="#国内yum源">国内YUM源</a></div><ul class="outline-children"></ul></li></ul></li></ul></li></ul></li></div></div><div id='write'  class=''><h1 id='linux学习笔记'><span>Linux学习笔记</span></h1><h2 id='目录'><span>目录</span></h2><div class='md-toc' mdtype='toc'><p class="md-toc-content" role="list"><span role="listitem" class="md-toc-item md-toc-h1" data-ref="n0"><a class="md-toc-inner" href="#linux学习笔记">Linux学习笔记</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n2"><a class="md-toc-inner" href="#目录">目录</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n4"><a class="md-toc-inner" href="#下载环境">下载环境</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n18"><a class="md-toc-inner" href="#linux的目录结构">Linux的目录结构</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n84"><a class="md-toc-inner" href="#远程连接">远程连接</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n105"><a class="md-toc-inner" href="#linux系统管理">Linux系统管理</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n106"><a class="md-toc-inner" href="#vi和vim">vi和vim</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n109"><a class="md-toc-inner" href="#命令模式一般模式）">命令模式（一般模式）：</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n120"><a class="md-toc-inner" href="#输入模式编辑模式）">输入模式（编辑模式）</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n141"><a class="md-toc-inner" href="#底线命令模式命令行）">底线命令模式（命令行）</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n151"><a class="md-toc-inner" href="#常用快捷键">常用快捷键</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n193"><a class="md-toc-inner" href="#linux用户管理">Linux用户管理</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n220"><a class="md-toc-inner" href="#linux组管理">Linux组管理</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n234"><a class="md-toc-inner" href="#linux系统操作">Linux系统操作</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n294"><a class="md-toc-inner" href="#配置环境变量">配置环境变量</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n349"><a class="md-toc-inner" href="#linux操作命令">Linux操作命令</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n350"><a class="md-toc-inner" href="#帮助命令">帮助命令</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n368"><a class="md-toc-inner" href="#文件目录命令">文件目录命令</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n546"><a class="md-toc-inner" href="#查找命令">查找命令</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n589"><a class="md-toc-inner" href="#通配符">通配符</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n601"><a class="md-toc-inner" href="#解压缩">解压缩</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n648"><a class="md-toc-inner" href="#组管理">组管理</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n666"><a class="md-toc-inner" href="#权限管理">权限管理</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n667"><a class="md-toc-inner" href="#文件权限概述">文件权限概述</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n692"><a class="md-toc-inner" href="#更改文件权限">更改文件权限</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n711"><a class="md-toc-inner" href="#网络配置">网络配置</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n712"><a class="md-toc-inner" href="#配置linux网络">配置Linux网络</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n716"><a class="md-toc-inner" href="#防火墙管理">防火墙管理</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n785"><a class="md-toc-inner" href="#进程管理">进程管理</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n787"><a class="md-toc-inner" href="#查看进程">查看进程</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n835"><a class="md-toc-inner" href="#终止进程">终止进程</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n844"><a class="md-toc-inner" href="#服务管理">服务管理</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n875"><a class="md-toc-inner" href="#查看网路服务了解">查看网路服务(了解)</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n889"><a class="md-toc-inner" href="#linux软件包管理">Linux软件包管理</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n890"><a class="md-toc-inner" href="#rpm">RPM</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n910"><a class="md-toc-inner" href="#yum">YUM</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n945"><a class="md-toc-inner" href="#国内yum源">国内YUM源</a></span></p></div><h2 id='下载环境'><span>下载环境</span></h2><ul><li><a href='https://www.vmware.com/products/workstation-pro/workstation-pro-evaluation.html'><span>VMware Workstation Pro</span></a></li><li><a href='https://my.vmware.com/en/web/vmware/downloads/info/slug/desktop_end_user_computing/vmware_workstation_player/16_0'><span>VMware Workstation Player</span></a></li><li><a href='https://www.virtualbox.org/wiki/Downloads'><span>VirtualBox</span></a></li><li><a href='https://www.netsarang.com/zh/free-for-home-school/'><span>XShell</span></a></li><li><a href='http://www.hostbuf.com/'><span>FinalShell</span></a></li><li><a href='https://www.centos.org/download/'><span>CentOS</span></a></li></ul><h2 id='linux的目录结构'><span>Linux的目录结构</span></h2><ul><li><span>Linux没有炫目的可视化操作界面，它的操作大部分都是直接执行命令，而可执行文件都是保存在相应的目录中的，所以我们对linux的操作大多数时候都是查找和执行这些可执行文件的。</span></li><li><span>linux的文件系统是采用级层式的树状目录结构，在此结构中的最上层是根目录“/”，然后在此目录下再创建其他的目录。</span></li><li><strong><span>在Linux世界里，一切皆文件。</span></strong></li></ul><p><img src="https://www.runoob.com/wp-content/uploads/2014/06/d0c50-linux2bfile2bsystem2bhierarchy.jpg" referrerpolicy="no-referrer" alt="Linux目录结构"></p><ul><li><strong><span>/bin</span></strong><span>：bin 是 Binaries (二进制文件) 的缩写, 这个目录存放着最经常使用的命令。</span></li><li><strong><span>/boot</span></strong><span>：这里存放的是启动 Linux 时使用的一些核心文件，包括一些连接文件以及镜像文件。</span></li><li><strong><span>/dev</span></strong><span> ：dev 是 Device(设备) 的缩写, 该目录下存放的是 Linux 的外部设备，在 Linux 中访问设备的方式和访问文件的方式是相同的。</span></li><li><strong><span>/etc</span></strong><span>：etc 是 Etcetera(等等) 的缩写,这个目录用来存放所有的系统管理所需要的配置文件和子目录。</span></li><li><strong><span>/home</span></strong><span>：用户的主目录，在 Linux 中，每个用户都有一个自己的目录，一般该目录名是以用户的账号命名的，如上图中的 alice、bob 和 eve。</span></li><li><strong><span>/lib</span></strong><span>：lib 是 Library(库) 的缩写这个目录里存放着系统最基本的动态连接共享库，其作用类似于 Windows 里的 DLL 文件。几乎所有的应用程序都需要用到这些共享库。</span></li><li><strong><span>/lost+found</span></strong><span>：这个目录一般情况下是空的，当系统非法关机后，这里就存放了一些文件。</span></li><li><strong><span>/media</span></strong><span>：linux 系统会自动识别一些设备，例如U盘、光驱等等，当识别后，Linux 会把识别的设备挂载到这个目录下。</span></li><li><strong><span>/mnt</span></strong><span>：系统提供该目录是为了让用户临时挂载别的文件系统的，我们可以将光驱挂载在 /mnt/ 上，然后进入该目录就可以查看光驱里的内容了。</span></li><li><strong><span>/opt</span></strong><span>：opt 是 optional(可选) 的缩写，这是给主机额外安装软件所摆放的目录。比如你安装一个ORACLE数据库则就可以放到这个目录下。默认是空的。</span></li><li><strong><span>/proc</span></strong><span>：proc 是 Processes(进程) 的缩写，/proc 是一种伪文件系统（也即虚拟文件系统），存储的是当前内核运行状态的一系列特殊文件，这个目录是一个虚拟的目录，它是系统内存的映射，我们可以通过直接访问这个目录来获取系统信息。</span><br/><span>这个目录的内容不在硬盘上而是在内存里，我们也可以直接修改里面的某些文件，比如可以通过下面的命令来屏蔽主机的ping命令，使别人无法ping你的机器：</span><code>echo 1 &gt; /proc/sys/net/ipv4/icmp_echo_ignore_all</code></li><li><strong><span>/root</span></strong><span>：该目录为系统管理员，也称作超级权限者的用户主目录。</span></li><li><strong><span>/sbin</span></strong><span>：s 就是 Super User 的意思，是 Superuser Binaries (超级用户的二进制文件) 的缩写，这里存放的是系统管理员使用的系统管理程序。</span></li><li><strong><span>/selinux</span></strong><span>：这个目录是 Redhat/CentOS 所特有的目录，Selinux 是一个安全机制，类似于 windows 的防火墙，但是这套机制比较复杂，这个目录就是存放selinux相关的文件的。</span></li><li><strong><span>/srv</span></strong><span>：该目录存放一些服务启动之后需要提取的数据。</span></li><li><strong><span>/sys</span></strong><span>：这是 Linux2.6 内核的一个很大的变化。该目录下安装了 2.6 内核中新出现的一个文件系统 sysfs 。</span><br/><span>sysfs 文件系统集成了下面3种文件系统的信息：针对进程信息的 proc 文件系统、针对设备的 devfs 文件系统以及针对伪终端的 devpts 文件系统。</span><br/><span>该文件系统是内核设备树的一个直观反映。</span><br/><span>当一个内核对象被创建的时候，对应的文件和目录也在内核对象子系统中被创建。</span></li><li><strong><span>/tmp</span></strong><span>：tmp 是 temporary(临时) 的缩写这个目录是用来存放一些临时文件的。</span></li><li><strong><span>/usr</span></strong><span>：usr 是 unix shared resources(共享资源)的缩写，这是一个非常重要的目录，用户的很多应用程序和文件都放在这个目录下，类似于 windows 下的 program files 目录。</span></li><li><strong><span>/usr/bin</span></strong><span>：系统用户使用的应用程序。</span></li><li><strong><span>/usr/sbin</span></strong><span>：超级用户使用的比较高级的管理程序和系统守护程序。</span></li><li><strong><span>/usr/src</span></strong><span>：内核源代码默认的放置目录。</span></li><li><strong><span>/var</span></strong><span>：var 是 variable(变量) 的缩写，这个目录中存放着在不断扩充着的东西，我们习惯将那些经常被修改的目录放在这个目录下。包括各种日志文件。</span></li><li><strong><span>/run</span></strong><span>：是一个临时文件系统，存储系统启动以来的信息。当系统重启时，这个目录下的文件应该被删掉或清除。如果你的系统上有 /var/run 目录，应该让它指向 run。</span></li></ul><p><span>在 Linux 系统中，有几个目录是比较重要的，平时需要注意不要误删除或者随意更改内部文件。</span></p><ul><li><span>/etc： 上边也提到了，这个是系统中的配置文件，如果你更改了该目录下的某个文件可能会导致系统不能启动。</span></li><li><span>/bin, /sbin, /usr/bin, /usr/sbin: 这是系统预设的执行文件的放置目录，比如 ls 就是在 /bin/ls 目录下的。</span></li><li><span>值得提出的是，/bin, /usr/bin 是给系统用户使用的指令（除root外的通用户），而/sbin, /usr/sbin 则是给 root 使用的指令。</span></li><li><span>/var： 这是一个非常重要的目录，系统上跑了很多程序，那么每个程序都会有相应的日志产生，而这些日志就被记录到这个目录下，具体在 /var/log 目录下，另外 mail 的预设放置也是在这里。</span></li></ul><h2 id='远程连接'><span>远程连接</span></h2><ul><li><p><span>Linux端口：22</span></p></li><li><p><span>查看Linux的IP地址</span><code>ifconfig</code></p></li><li><p><span>最小安装没有网络工具</span><code>yum install net-tools</code></p></li><li><p><span>终端命令：</span></p><ul><li><code>-p</code><span>：指定端口</span></li><li><code>-l</code><span>：指定用户名</span></li><li><code>ssh -l 用户名 -p 端口 IP地址</code></li><li><code>ssh -p 端口 用户名@IP地址</code></li><li><code>ssh -l root -p 22 192.168.0.102</code></li></ul></li></ul><h2 id='linux系统管理'><span>Linux系统管理</span></h2><h3 id='vi和vim'><span>vi和vim</span></h3><p><img src="https://www.runoob.com/wp-content/uploads/2015/10/vi-vim-cheat-sheet-sch.gif" referrerpolicy="no-referrer" alt="vim键盘图"></p><p><span>基本上 vi/vim 共分为三种模式，分别是命令模式（Command mode），输入模式（Insert mode）和底线命令模式（Last line mode）。 这三种模式的作用分别是：   </span></p><h4 id='命令模式一般模式）'><span>命令模式（一般模式）：</span></h4><p><span>用户刚刚启动 vi/vim，便进入了命令模式。</span><br/><span>此状态下敲击键盘动作会被Vim识别为命令，而非输入字符。比如我们此时按下i，并不会输入一个字符，i被当作了一个命令。  </span></p><p><span>以下是常用的几个命令：  </span></p><ul><li><span>i 切换到输入模式，以输入字符。</span></li><li><span>x 删除当前光标所在处的字符。</span></li><li><span>: 切换到底线命令模式，以在最底一行输入命令。</span></li></ul><p><span>若想要编辑文本：启动Vim，进入了命令模式，按下i，切换到输入模式。</span><br/><span>命令模式只有一些最基本的命令，因此仍要依靠底线命令模式输入更多命令。  </span></p><h4 id='输入模式编辑模式）'><span>输入模式（编辑模式）</span></h4><p><span>在命令模式下按下i就进入了输入模式。  </span><br/><span>在输入模式中，可以使用以下按键：    </span></p><ul><li><span>字符按键以及Shift组合，输入字符</span></li><li><span>ENTER，回车键，换行</span></li><li><span>BACK SPACE，退格键，删除光标前一个字符</span></li><li><span>DEL，删除键，删除光标后一个字符</span></li><li><span>方向键，在文本中移动光标</span></li><li><span>HOME/END，移动光标到行首/行尾</span></li><li><span>Page Up/Page Down，上/下翻页</span></li><li><span>Insert，切换光标为输入/替换模式，光标将变成竖线/下划线</span></li><li><span>ESC，退出输入模式，切换到命令模式</span></li></ul><h4 id='底线命令模式命令行）'><span>底线命令模式（命令行）</span></h4><p><span>在命令模式下按下‘:’（</span><strong><span>英文冒号</span></strong><span>）就进入了底线命令模式。</span><br/><span>底线命令模式可以输入单个或多个字符的命令，可用的命令非常多。</span><br/><span>在底线命令模式中，基本的命令有（已经省略了冒号）：  </span></p><ul><li><span>q 退出程序</span></li><li><span>w 保存文件</span></li></ul><p><span>按ESC键可随时退出底线命令模式。  </span><br/><span>简单的说，我们可以将这三个模式想成底下的图标来表示：   </span></p><p><img src="https://www.runoob.com/wp-content/uploads/2014/07/vim-vi-workmodel.png" referrerpolicy="no-referrer" alt="vim工作模式"></p><h4 id='常用快捷键'><span>常用快捷键</span></h4><p><strong><span>一般模式</span></strong></p><figure><table><thead><tr><th><span>行为</span></th><th><span>快捷键</span></th></tr></thead><tbody><tr><td><span>复制当前行</span></td><td><span>yy</span></td></tr><tr><td><span>复制当前n行</span></td><td><span>nyy</span></td></tr><tr><td><span>粘贴</span></td><td><span>p</span></td></tr><tr><td><span>删除当前行</span></td><td><span>dd</span></td></tr><tr><td><span>删除当前n行</span></td><td><span>ndd</span></td></tr><tr><td><span>撤消</span></td><td><span>u</span></td></tr><tr><td><span>关键字向上查找</span></td><td><span>?word</span></td></tr><tr><td><span>关键字向下查找</span></td><td><span>/word</span></td></tr><tr><td><span>查找</span></td><td><span>n</span></td></tr><tr><td><span>反向查找</span></td><td><span>N</span></td></tr><tr><td><span>显示行号</span></td><td><span>:set nu</span></td></tr><tr><td><span>关闭行号</span></td><td><span>:set nonu</span></td></tr></tbody></table></figure><h3 id='linux用户管理'><span>Linux用户管理</span></h3><ul><li><p><span>Linux系统是一个多用户多任务的操作系统，任何一个要使用系统资源的用户，都必须首先向系统管理员申请一个账号，然后以这个账号的身份进入系统。root用户是系统默认创建的管理员账号。</span></p></li><li><p><span>添加用户：</span><code>useradd 用户名</code></p><ul><li><code>useradd -d /home/ls lisi</code><span>：创建一个账号叫lisi，并且给lisi指定家目录/ls。</span></li><li><code>passwd 用户名</code><span>设置密码</span></li></ul></li><li><p><span>删除用户：</span><code>userdel 用户名</code></p><ul><li><code>userdel –r 用户名</code><span>：删除用户，并把用户目录也删除。</span></li></ul></li><li><p><span>查询用户信息：</span><code>id 用户名</code></p></li><li><p><span>切换用户：</span><code>su 用户名</code></p><ul><li><span>从高权限用户切换到低权限用户时，不需要输密码；否则，需要输密码。</span></li><li><span>另：exit命令可以回到原来的用户。</span></li></ul></li><li><p><code>sudo</code><span>：用root用户执行某条指令</span></p></li></ul><h3 id='linux组管理'><span>Linux组管理</span></h3><ul><li><span>Linux的组类似于角色，系统可以对有共性的多个用户进行统一的管理。</span><strong><span>每一个用户都至少属于一个组</span></strong><span>，创建用户时如果不指定组，会默认创建一个跟用户名相同的组，并且把新创建的用户分配到组中，root用户默认属于root组。</span></li><li><span>添加组：</span><code>groupadd 组名</code></li><li><span>删除组：</span><code>groupdel 组名</code></li><li><span>用户进组：</span><code>gpasswd -a 用户名 组名</code></li><li><span>用户出组：</span><code>gpasswd -d 用户名 组名</code></li><li><span>新建用户指定主组：</span><code>useradd -g 组名 用户名</code></li></ul><h3 id='linux系统操作'><span>Linux系统操作</span></h3><ul><li><p><code>clear</code><span>：清屏，保留历史命令</span></p></li><li><p><code>shutdown now</code><span>： 立即关机</span></p></li><li><p><code>shudown -h 1</code><span>：  1小时后关机</span></p></li><li><p><code>shutdown –r now</code><span>： 立即重启</span></p></li><li><p><code>reboot</code><span>： 立即重启</span></p></li><li><p><code>sync</code><span>： 内存的数据同步到磁盘.</span></p></li><li><p><code>whoami</code><span>：当前用户</span></p></li><li><p><code>uname [options]</code><span>：显示系统信息</span></p><ul><li><code>-a</code><span>：显示全部的信息。</span></li><li><code>-m</code><span>：显示电脑类型。</span></li><li><code>-n</code><span>：显示在网络上的主机名称。</span></li><li><code>-r</code><span>：显示操作系统的发行编号。</span></li><li><code>-s</code><span>：显示操作系统名称。</span></li><li><code>-v</code><span>：显示操作系统的版本。</span></li></ul></li><li><p><code>date</code><span>：显示当前时间</span></p><ul><li><code>date [+&#39;FORMAT&#39;]</code></li><li><code>date &#39;+%Y-%m-%d %H:%M:%S %j&#39;</code></li><li><code>date -s 字符串</code><span>：设置时间</span></li><li><a href='https://www.runoob.com/linux/linux-comm-date.html' target='_blank' class='url'>https://www.runoob.com/linux/linux-comm-date.html</a></li></ul></li><li><p><code>cal</code><span>：查看本月日历</span></p><ul><li><code>cal 年份</code><span>：查看某一年日历</span></li></ul></li><li><p><code>bc</code><span>：计算器</span></p><ul><li><span>执行</span><code>bc</code><span>后，输入</span><code>scale=数字</code><span>设置小数点位，默认小数点0位</span></li></ul></li><li><p><code>cat /proc/version</code><span>：显示内核版本</span></p></li><li><p><code>cat /etc/redhat-release</code><span>： 查看操作系统版本</span></p></li><li><p><code>/etc/passwd</code><span>：用户信息配置文件</span></p></li><li><p><code>/etc/shadow</code><span>：用户密码信息配置文件</span></p></li></ul><h3 id='配置环境变量'><span>配置环境变量</span></h3><p><span>查看环境变量PATH的值：</span><code>echo $PATH</code>
<span>输出当前系统所有的环境变量：</span><code>export</code></p><ol start='' ><li><p><span>执行命令：</span><code>export PATH:$PATH</code></p><ul><li><code>export PATH=$PATH:/home/uusama/mysql/bin</code></li><li><span>生效时间：立即生效</span></li><li><span>生效期限：当前终端有效，窗口关闭后无效</span></li><li><span>生效范围：仅对当前用户有效</span></li><li><span>配置的环境变量中不要忘了加上原来的配置，即$PATH部分，避免覆盖原来配置</span></li></ul></li><li><p><span>修改文件</span></p><ol start='' ><li><code>JAVA_HOME=/opt/java-1.8</code></li><li><code>PATH=$PATH:$JAVA_HOME/bin</code></li><li><code>export JAVA_HOME PATH</code></li><li><span>命令行执行：</span><code>source 配置文件</code></li></ol><ul><li><span>生效时间：</span><code>source</code><span>命令后生效</span></li><li><span>生效期限：永久</span></li><li><span>生效范围：用户文件仅对当前用户有效，系统文件对所有用户有效</span></li></ul></li></ol><ul><li><p><span>用户级别环境变量定义文件：</span><code>~/.bashrc</code><span>、</span><code>~/.profile</code><span>（部分系统为：</span><code>~/.bash_profile</code><span>）</span></p></li><li><p><span>系统级别环境变量定义文件</span><code>：/etc/bashrc</code><span>、</span><code>/etc/profile</code><span>(部分系统为：</span><code>/etc/bash_profile</code><span>）、</span><code>/etc/environment</code></p></li><li><p><span>Linux加载环境变量的顺序为</span></p><ol start='' ><li><span>/etc/environment</span></li><li><span>/etc/profile</span></li><li><span>/etc/bash.bashrc</span></li><li><span>/etc/profile.d/test.sh</span></li><li><span>~/.profile</span></li><li><span>~/.bashrc</span></li></ol></li></ul><h2 id='linux操作命令'><span>Linux操作命令</span></h2><h3 id='帮助命令'><span>帮助命令</span></h3><ol start='' ><li><p><span>用来查看linux系统手册上的帮助信息：</span><code>man 命令</code></p><ul><li><code>man ls</code></li><li><span>分屏显示、按回车翻一行、按空格翻一页、按q退出查看。</span></li></ul></li><li><p><span>用来查看命名的内置帮助信息：</span></p><ul><li><code>help 命令</code></li><li><code>命令 --help</code></li><li><span>版本信息：</span><code>命令 --version</code></li></ul></li></ol><h3 id='文件目录命令'><span>文件目录命令</span></h3><ul><li><p><span>查看当前路径：</span><code>pwd</code></p></li><li><p><span>查看目录下的文件及目录列表：</span><code>ls [选项]</code><span> 查看当前目录</span></p><ul><li><p><code>ls [选项] [指定路径]</code><span>：查看指定目录</span></p></li><li><p><code>-s</code><span>：显示文件大小</span></p></li><li><p><code>-l</code><span>：列表形式显示</span></p><ul><li><code>-h</code><span>：易读大小</span><code>ls -lh</code></li></ul></li><li><p><code>-a</code><span>：显示所有文件（包括隐藏文件）</span></p></li><li><p><code>-R</code><span>：目录递归显示</span></p></li><li><p><code>-S</code><span>：大小排序</span></p></li><li><p><code>-t</code><span>：时间排序</span></p></li><li><p><code>-r</code><span>：反向排序</span></p></li></ul></li><li><p><span>查看空间大小：</span><code>du [参数] [文件]</code></p><ul><li><code>-a</code><span>：显示目录中所有文件大小</span></li><li><code>-k</code><span>：以KB为单位显示文件大小</span></li><li><code>-m</code><span>：以MB为单位显示文件大小</span></li><li><code>-g</code><span>：以GB为单位显示文件大小</span></li><li><code>-h</code><span>：以易读方式显示文件大小（常用）</span></li><li><code>-s</code><span>：文件大小的总计（用来看目录大小）</span></li><li><code>du -sh /opt</code><span>：查看opt文件夹大小</span></li></ul></li><li><p><span>切换目录：</span><code>cd</code><span>：切换到用户目录，同</span><code>cd ~</code></p><ul><li><code>cd [路径]</code><span>：支持相对路径、绝对路径</span></li></ul></li><li><p><span>创建目录：</span><code>mkdir [option] 路径</code></p><ul><li><span>递归创建多级目录：</span><code>mkdir -p 目录/目录/目录</code></li></ul></li><li><p><span>删除空目录：</span><code>rmdir [option] 目录名</code></p><ul><li><span>递归删除多级空目录：</span><code>rmdir -p 目录/目录/目录</code></li></ul></li><li><p><span>创建空文件：</span><code>touch 文件1 文件2 文件3</code></p></li><li><p><span>复制：</span><code>cp [option] source... dest</code><span>    </span></p><ul><li><code>-r</code><span>：递归持续复制，用于目录的复制行为；(常用)</span></li><li><code>-p</code><span>：保留用户权限</span></li><li><code>-d</code><span>：若源文件为连接文件属性，则复制连接文件属性而非文件本身。</span></li><li><code>-a</code><span>：相当于</span><code>-dpr</code></li><li><code>-f</code><span>：直接覆盖</span></li></ul></li><li><p><span>剪切：</span><code>mv [option] source... dest</code></p><ul><li><code>-f</code><span> ：直接覆盖</span></li><li><strong><span>文件重命名</span></strong><span>：</span><code>mv [option] 文件 文件</code></li></ul></li><li><p><span>删除：</span><code>rm [option] 文件或目录</code></p><ul><li><code>-r</code><span> ：递归删除啊！最常用在目录的删除了！这是非常危险的选项！！！</span></li><li><code>-f</code><span> ：就是 force 的意思，忽略不存在的文件，不会出现警告信息；</span></li><li><code>rm -rf /*</code><span>：删库跑路！！！！！（不要执行）</span></li></ul></li><li><p><span>查看命令</span></p><ul><li><p><span>cat  由第一行开始显示文件内容（常用）</span></p><ul><li><span>-A ：相当於 -vET 的整合选项，可列出一些特殊字符而不是空白而已；</span></li><li><span>-b ：列出行号，仅针对非空白行做行号显示，空白行不标行号！</span></li><li><span>-E ：将结尾的断行字节 $ 显示出来；</span></li><li><span>-n ：列印出行号，连同空白行也会有行号，与 -b 的选项不同；</span></li><li><span>-T ：将 [tab] 按键以 ^I 显示出来；</span></li><li><span>-v ：列出一些看不出来的特殊字符</span></li></ul></li><li><p><span>tac  从最后一行开始显示，可以看出 tac 是 cat 的倒着写！</span></p></li><li><p><span>nl   显示的时候，顺道输出行号！</span></p><ul><li><span>-b ：指定行号指定的方式，主要有两种：</span></li><li><span>-b a ：表示不论是否为空行，也同样列出行号(类似 cat -n)；</span></li><li><span>-b t ：如果有空行，空的那一行不要列出行号(默认值)；</span></li><li><span>-n ：列出行号表示的方法，主要有三种：</span></li><li><span>-n ln ：行号在荧幕的最左方显示；</span></li><li><span>-n rn ：行号在自己栏位的最右方显示，且不加 0 ；</span></li><li><span>-n rz ：行号在自己栏位的最右方显示，且加 0 ；</span></li><li><span>-w num ：行号栏位的占用的位数。</span></li></ul></li><li><p><span>more 一页一页的显示文件内容</span></p><ul><li><span>空白键 (space)：代表向下翻一页；</span></li><li><span>Enter         ：代表向下翻『一行』；</span></li><li><span>/字串         ：代表在这个显示的内容当中，向下搜寻『字串』这个关键字；</span></li><li><span>:f            ：立刻显示出档名以及目前显示的行数；</span></li><li><span>q             ：代表立刻离开 more ，不再显示该文件内容。</span></li><li><span>b 或 [ctrl]-b ：代表往回翻页，不过这动作只对文件有用，对管线无用。</span></li></ul></li><li><p><span>less 与 more 类似，但是比 more 更好的是，他可以往前翻页！</span></p><ul><li><span>空白键    ：向下翻动一页；</span></li><li><span>[pagedown]：向下翻动一页；</span></li><li><span>[pageup]  ：向上翻动一页；</span></li><li><span>/字串     ：向下搜寻『字串』的功能；</span></li><li><span>?字串     ：向上搜寻『字串』的功能；</span></li><li><span>n         ：重复前一个搜寻 (与 / 或 ? 有关！)</span></li><li><span>N         ：反向的重复前一个搜寻 (与 / 或 ? 有关！)</span></li><li><span>q         ：离开 less 这个程序；</span></li></ul></li><li><p><span>head 只看头几行</span></p><ul><li><span>-n ：后面接数字，代表显示几行的意思（默认10行）</span></li></ul></li><li><p><span>tail 只看尾巴几行</span></p></li></ul></li><li><p><span>echo：输出内容到控制台</span></p><ul><li><code>echo $PATH</code><span>：查看环境变量</span></li></ul></li><li><p><code>指令 &gt; 目标文件</code><span>：将执行结果覆盖到目标文件上</span></p></li><li><p><code>指令 &gt;&gt; 目标文件</code><span>：追加</span></p></li></ul><h3 id='查找命令'><span>查找命令</span></h3><ul><li><p><code>find [路径] [参数] 条件</code></p><ul><li><code>-name</code><span>：按名字查找目录及所有子目录（占位符</span><code>*</code><span>）</span></li><li><code>-size</code><span>：按大小 +5M（大于5MB） -9k（小于9kB）</span></li><li><code>-user</code><span>：按所有者</span></li></ul></li><li><p><code>locate 要搜索的文件名</code></p><ul><li><code>updatedb</code><span>：更新搜索数据库</span></li></ul></li><li><p><code>grep [option] 正则 文件</code><span>使用正则表达式搜索文本，把匹配的行打印出来</span></p><ul><li><code>-i</code><span>：忽略大小写</span></li><li><code>-c</code><span>：只输出匹配行的计数。</span></li><li><code>-n</code><span>：显示匹配行及 行号。</span></li><li><code>-v</code><span>：反转匹配，选择没有被匹配到的内容。</span></li><li><code>-w</code><span>：匹配整词，精确地单词,单词的两边必须是非字符符号(即不能是字母数字或下划线)</span></li><li><code>-x</code><span>：仅选择与整行完全匹配的匹配项。精确匹配整行内容(包括行首行尾那些看不到的空格内容都要完全匹配)</span></li><li><code>-r -d</code><span>：以递归的方式匹配</span></li><li><code>-e</code><span>: 使用正则搜索</span></li><li><code>-A</code><span>: 显示匹配行及前面多少行, 如: -A3, 则表示显示匹配行及前3行</span></li><li><code>-B</code><span>: 显示匹配行及后面多少行, 如: -B3, 则表示显示匹配行及后3行</span></li><li><code>-C</code><span>: 显示匹配行前后多少行, 如: -C3, 则表示显示批量行前后3行</span></li><li><strong><span>可以配合其指令输出指定的结果</span></strong><span>：</span><code>rpm -q -a | grep -i java</code></li></ul></li></ul><h3 id='通配符'><span>通配符</span></h3><ul><li><code>*</code><span>：匹配任意字符</span></li><li><code>?</code><span>：匹配单个字符</span></li><li><code>[xyz]</code><span>：匹配xyz中任一个字符</span></li><li><code>[a-z]</code><span>、</span><code>[0-9]</code><span>：范围匹配</span></li><li><code>[!xyz]</code><span>、</span><code>[^xyz]</code><span>：反向匹配</span></li></ul><h3 id='解压缩'><span>解压缩</span></h3><ul><li><p><code>gzip</code></p><ul><li><span>单个文件的解压缩，解压和压缩都会把原文件删除</span></li><li><span>压缩：</span><code>gzip 文件</code></li><li><span>解压：</span><code>gunzip 文件.gz</code></li><li><span>后缀：.gz</span></li></ul></li><li><p><code>zip</code></p><ul><li><span>多个文件的解压缩</span></li><li><span>压缩：</span><code>zip 包名.zip 文件目录列表</code></li><li><span>解压：</span><code>unzip 压缩文件.zip -d 路径</code></li><li><span>后缀：.zip</span></li></ul></li><li><p><code>tar</code></p><ul><li><span>多个文件的打包和压缩（常用）</span></li><li><span>压缩：</span><code>tar [选项] 包名.tar.gz 文件目录列表</code></li><li><span>解压：</span><code>tar [选项] 包名.tar.gz -C 路径</code></li><li><code>-c</code><span>：打包</span></li><li><code>-v</code><span>：显示执行过程</span></li><li><code>-f</code><span>：指定压缩文件名</span></li><li><code>-z</code><span>：打包后通过gzip（打包并压缩）</span></li><li><code>-x</code><span>：解压</span></li><li><code>-C</code><span>：指定路径</span></li><li><span>后缀：.tar.gz</span></li></ul></li></ul><h3 id='组管理'><span>组管理</span></h3><ul><li><span>Linux 系统是一种典型的多用户系统，不同的用户处于不同的地位，拥有不同的权限。</span></li><li><span>在linux中的每个用户必须属于一个组，不能独立于组外，可以改变用户所属组。用户属于多个组</span></li><li><span>每个文件、目录也必须属于一个组，只能属于一个组。</span></li><li><span>如何看所属用户和组：</span><code>ls -l</code></li><li><span>修改文件的所属用户：</span><code>chown [option] 新的所属用户 文件</code></li><li><span>修改文件的所属组：</span><code>chgrp [option] 新的所属组 文件</code></li><li><span>修改文件的所属用户及所属组：</span><code>chown [option] 新的所属用户:新的所属组 文件</code></li><li><code>-R</code><span>：递归修改</span></li></ul><h3 id='权限管理'><span>权限管理</span></h3><h4 id='文件权限概述'><span>文件权限概述</span></h4><p><span>查看目录或文件的权限：</span><code>ls -l</code></p><p><img src="https://www.runoob.com/wp-content/uploads/2014/06/file-llls22.jpg" referrerpolicy="no-referrer" alt="文件列表详解"></p><p><span>文件信息的第一列为权限，第一个字母表示文件类型</span></p><ul><li><span>当为 d 则是目录</span></li><li><span>当为 - 则是文件；</span></li><li><span>若是 l 则表示为链接文档(link file)；</span></li><li><span>若是 b 则表示为装置文件里面的可供储存的接口设备(可随机存取装置)；</span></li><li><span>若是 c 则表示为装置文件里面的串行端口设备，例如键盘、鼠标(一次性读取装置)。</span></li></ul><p><span>接下来的字符中，以三个为一组，且均为</span><code>rwx</code><span>的三个参数的组合。其中， r 代表可读(read)、 w 代表可写(write)、 x 代表可执行(execute)。 要注意的是，</span><strong><span>这三个权限的位置不会改变，如果没有权限，就会出现减号 - 而已。</span></strong></p><p><img src="https://www.runoob.com/wp-content/uploads/2014/06/363003_1227493859FdXT.png" referrerpolicy="no-referrer" alt="文件属性详解"></p><p><span>每个文件都有三种身份，每个身份有三个rwx权限</span></p><ul><li><span>属主权限（user）</span></li><li><span>属组权限（group）</span></li><li><span>其它组权限（other）</span></li></ul><h4 id='更改文件权限'><span>更改文件权限</span></h4><p><span>Linux 文件的基本权限就有九个，分别是 owner/group/others(拥有者/组/其他) 三种身份各有自己的 read/write/execute 权限。</span></p><ol start='' ><li><p><code>chmod [u][g][o][a] [+][-][=] [r][w][x],... 文件</code></p><ul><li><span>u = user、g = group、o = other、a = all、+增加、-去除、=设为 </span></li></ul></li><li><p><code>chmod [u][g][o][a] = [r][w][x],... 文件</code></p><ul><li><span>将rwx组合设置</span></li></ul></li><li><p><code>chmod [0-7][0-7][0-7] 文件</code></p><ul><li><span>每个身份的三种权限用1和0来开关，然后转为八进制（常用）</span></li></ul></li></ol><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang=""><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.2px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><span><span>​</span>x</span></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">-rw-rw-r--. 1 root root 526 8月  12 15:16 1.txt</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">----------&gt;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">-rwxrw-r-x. 1 root root 526 8月  12 15:16 1.txt</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">chmod u+x,o+x 1.txt</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">chmod u=rwx,o=rx 1.txt</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">chmod 765 1.txt</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 179px;"></div><div class="CodeMirror-gutters" style="display: none; height: 179px;"></div></div></div></pre><h2 id='网络配置'><span>网络配置</span></h2><h3 id='配置linux网络'><span>配置Linux网络</span></h3><p><span>打开文件：/etc/sysconfig/network-scripts/ifcfg-ens33</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang=""><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.2px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">BOOTPROTO="static"</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">ONBOOT="yes"</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">IPADDR=192.168.11.128</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">GATEWAY=192.168.11.2</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">DNS1=192.168.11.2</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">重启linux:  reboot</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">systemctl restart network.service</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 157px;"></div><div class="CodeMirror-gutters" style="display: none; height: 157px;"></div></div></div></pre><p><img src="https://upload-images.jianshu.io/upload_images/24973821-55c47db669a36610.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" referrerpolicy="no-referrer" alt="image53.png"></p><h3 id='防火墙管理'><span>防火墙管理</span></h3><ul><li><p><span>查看端口监听</span></p><ul><li><code>netstat -lnpt</code></li></ul></li><li><p><span>查看防火墙新状态</span></p><ul><li><code>systemctl status firewalld</code></li></ul></li><li><p><span>开启、关闭、重启</span></p><ul><li><code>systemctl start firewalld</code></li><li><code>systemctl stop firewalld</code></li><li><code>systemctl restart firewalld</code></li></ul></li><li><p><span>查看所有已开放端口</span></p><ul><li><code>firewall-cmd --list-ports</code></li></ul></li><li><p><span>开启端口</span></p><ul><li><code>firewall-cmd --zone=public --add-port=80/tcp --permanent</code></li><li><span>重启后端口生效</span></li><li><span>命令含义：  </span><code>--zone</code><span> 作用域   </span><code>--add-port=80/tcp</code><span> 添加端口，格式为：端口/通讯协议   </span><code>--permanent</code><span> 永久生效，没有此参数重启后失效</span></li></ul></li><li><p><span>关闭端口</span></p><ul><li><code>firewall-cmd --zone=public --remove-port=80/tcp --permanent</code></li></ul></li><li><p><span>其它常用命令</span></p><ul><li><code>firewall-cmd --state</code><span>查看防火墙状态，是否是running</span></li><li><code>firewall-cmd --reload</code><span>重新载入配置，比如添加规则之后，需要执行此命令</span></li><li><code>firewall-cmd --get-zones</code><span>列出支持的zone</span></li><li><code>firewall-cmd --get-services</code><span>列出支持的服务，在列表中的服务是放行的</span></li><li><code>firewall-cmd --query-service ftp</code><span>查看ftp服务是否支持，返回yes或者no</span></li><li><code>firewall-cmd --add-service=ftp</code><span>临时开放ftp服务</span></li><li><code>firewall-cmd --add-service=ftp --permanent</code><span>永久开放ftp服务</span></li><li><code>firewall-cmd --remove-service=ftp --permanent</code><span>永久移除ftp服务</span></li><li><code>firewall-cmd --add-port=80/tcp --permanent</code><span>永久添加80端口 </span></li><li><code>firewall-cmd --remove-port=80/tcp --permanent</code><span>永久移除80端口 </span></li><li><code>firewall-cmd --zone=public --list-ports</code><span>查看已开放的端口</span></li><li><code>iptables -L -n</code><span>查看规则，这个命令是和iptables的相同的</span></li><li><code>man firewall-cmd</code><span> </span></li></ul></li></ul><h2 id='进程管理'><span>进程管理</span></h2><p><span>在Linux中，每个执行的程序（代码）都称为一个进程。每一个进程都分配一个ID号。每一个进程，都会对应一个父进程。</span><br/><span>进程有两种运行方式：前台和后台。前台方式是目前用户可以在前台操作的，后台方式是实际在运行，但用户在前台看不见。</span><br/><span>一般系统的服务都是以后台进程的方式存在，而且都会常驻在系统中。直到关机才结束。</span></p><h3 id='查看进程'><span>查看进程</span></h3><ul><li><p><code>ps [options]</code></p><ul><li><code>–a</code><span>：显示当前终端下的所有进程信息</span></li><li><code>–u</code><span>：以用户的格式显示进程信息</span></li><li><code>–x</code><span>：显示后台进程运行的参数</span></li><li><code>–e</code><span>：显示所有进程信息</span></li><li><code>–f</code><span>：以全格式显示进程信息</span></li></ul></li><li><p><span>显示结果说明</span></p><ul><li><code>USER</code><span>：用户名称</span></li><li><code>PID</code><span>：进程号</span></li><li><code>%CPU</code><span>：进程占用CPU的百分比</span></li><li><code>%MEM</code><span>：进程占用物理内存的百分比</span></li><li><code>VSZ</code><span>：进程占用的虚拟内存大小（单位：KB）</span></li><li><code>RSS</code><span>：进程占用的物理内存大小（单位：KB）</span></li><li><code>TT</code><span>：终端名称,缩写.</span></li><li><code>STAT</code><span>：进程状态，其中S-睡眠，s-表示该进程是会话的先导进程，N-表示进程拥有比普通优先级更低的优先级，R-正在运行，D-短期等待，Z-僵死进程，T-被跟踪或者被停止等等</span></li><li><code>STARTED</code><span>：进程的启动时间</span></li><li><code>TIME</code><span>：CPU时间，即进程使用CPU的总时间</span></li><li><code>COMMAND</code><span>：启动进程所用的命令和参数，如果过长会被截断显示</span></li><li><code>PPID</code><span> 父进程的ID</span></li><li><code>C</code><span> CPU使用的资源百分比</span></li><li><span>PRI指进程的执行优先权(Priority的简写)，其值越小越早被执行</span></li><li><code>SZ</code><span> 使用掉的内存大小</span></li></ul></li></ul><h3 id='终止进程'><span>终止进程</span></h3><ul><li><p><code>kill [options] 进程ID</code></p><ul><li><span>-9:表示强迫进程立即停止。</span></li></ul></li><li><p><code>killall 进程名称(支持通配符)</code></p></li></ul><h3 id='服务管理'><span>服务管理</span></h3><p><span>服务是支持Linux运行的一些必要程序，本质上也是进程，</span><strong><span>叫守护进程</span></strong><span>。守护进程通常默默地运行在后台，为应用程序提供必要支撑，比如sshd、防火墙等。</span></p><p><span>命令格式：</span><code>systemctl [option] 服务名称</code></p><ul><li><span>start：立刻启动后面接的 unit。</span></li><li><span>stop：立刻关闭后面接的 unit。</span></li><li><span>restart：立刻关闭后启动后面接的 unit，亦即执行 stop 再 start 的意思。</span></li><li><span>reload：不关闭 unit 的情况下，重新载入配置文件，让设置生效。</span></li><li><span>enable：设置下次开机时，后面接的 unit 会被启动。</span></li><li><span>disable：设置下次开机时，后面接的 unit 不会被启动。</span></li><li><span>status：目前后面接的这个 unit 的状态，会列出有没有正在执行、开机时是否启动等信息。</span></li><li><span>is-active：目前有没有正在运行中。</span></li><li><span>is-enable：开机时有没有默认要启用这个 unit。</span></li><li><span>kill ：不要被 kill 这个名字吓着了，它其实是向运行 unit 的进程发送信号。</span></li><li><span>show：列出 unit 的配置。</span></li><li><span>mask：注销 unit，注销后你就无法启动这个 unit 了。</span></li><li><span>unmask：取消对 unit 的注销。</span></li></ul><p><span>CentOS7之前，使用命令</span><code>service 服务名称 [option]</code></p><h4 id='查看网路服务了解'><span>查看网路服务(了解)</span></h4><ul><li><p><code>netstat [options]</code></p><ul><li><code>-an</code><span> 按一定顺序排列输出</span></li><li><code>-p</code><span> 显示哪个进程在调用</span></li></ul></li><li><p><code>ping IP地址</code></p><ul><li><span>查看网络连接状态</span></li></ul></li></ul><h2 id='linux软件包管理'><span>Linux软件包管理</span></h2><h3 id='rpm'><span>RPM</span></h3><ul><li><p><span>在Centos7的</span><code>/run/media/user1/CentOS 7 x86_64/Packages</code><span>目录下有很多自带的RPM包</span></p></li><li><p><code>rpm –q -a</code><span> :查询所安装的所有软件包 </span></p></li><li><p><code>rpm –e [option] 软件包名称</code></p><ul><li><code>-nodeps</code><span> 表示强制删除，用于被删除的软件包有依赖的情况</span></li></ul></li><li><p><code>rpm [options] RPM包全路径名</code></p><ul><li><code>-i</code><span>=install 安装</span></li><li><code>-v</code><span>=verbose 提示</span></li><li><code>-h</code><span>=hash 进度条</span></li></ul></li></ul><h3 id='yum'><span>YUM</span></h3><p><span>Yum 是一个Shell前端软件包管理器。基于RPM包管理，能够从指定的服务器(在公网上)自动下载RPM包并且安装，可以自动处理依赖性关系，并且一次安装所有依赖的软件包。</span><br/><strong><span>注意：使用YUM的前提是可以连接外网。</span></strong><span>  </span></p><ul><li><p><code>yum list</code><span>：列出可安装的软件</span></p></li><li><p><code>yum list installed | grep xx</code><span>：查询已安装到本地的</span></p></li><li><p><code>yum [option] install 包名</code><span>：安装</span></p><ul><li><code>-y</code><span>：自动yes</span></li><li><code>-q</code><span>：不显示安装过程</span></li><li><code>-h</code><span>：帮助</span></li></ul></li><li><p><code>yum remove 包名</code><span>：卸载</span></p></li><li><p><code>yum check-update</code><span>：检查所有软件更新</span></p></li><li><p><code>yum update</code><span>：更新所有可更新的软件</span></p></li><li><p><code>yum update 包名</code><span>：更新指定可更新的软件</span></p></li><li><p><span>清除缓存命令:</span></p><ul><li><code>yum clean packages</code><span>: 清除缓存目录下的软件包</span></li><li><code>yum clean headers</code><span>: 清除缓存目录下的 headers</span></li><li><code>yum clean oldheaders</code><span>: 清除缓存目录下旧的 headers</span></li><li><code>yum clean, yum clean all (= yum clean packages; yum clean oldheaders)</code><span> :清除缓存目录下的软件包及旧的 headers</span></li></ul></li></ul><h4 id='国内yum源'><span>国内YUM源</span></h4><p><span>网易（163）yum源是国内最好的yum源之一 ，无论是速度还是软件版本，都非常的不错。</span>
<span>将yum源设置为163 yum，可以提升软件包安装和更新的速度，同时避免一些常见软件版本无法找到。</span></p><p><strong><span>安装步骤</span></strong><span>  </span></p><p><span>首先备份/etc/yum.repos.d/CentOS-Base.repo  </span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang=""><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.2px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup</span></pre></div></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 22px;"></div><div class="CodeMirror-gutters" style="display: none; height: 22px;"></div></div></div></pre><p><span>下载对应版本 repo 文件, 放入 /etc/yum.repos.d/ (操作前请做好相应备份)  </span></p><ul><li><span>CentOS5 ：</span><a href='http://mirrors.163.com/.help/CentOS5-Base-163.repo' target='_blank' class='url'>http://mirrors.163.com/.help/CentOS5-Base-163.repo</a></li><li><span>CentOS6 ：</span><a href='http://mirrors.163.com/.help/CentOS6-Base-163.repo' target='_blank' class='url'>http://mirrors.163.com/.help/CentOS6-Base-163.repo</a></li><li><span>CentOS7 ：</span><a href='http://mirrors.163.com/.help/CentOS7-Base-163.repo' target='_blank' class='url'>http://mirrors.163.com/.help/CentOS7-Base-163.repo</a></li></ul><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang=""><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.2px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">wget http://mirrors.163.com/.help/CentOS6-Base-163.repo</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">mv CentOS6-Base-163.repo CentOS-Base.repo</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 45px;"></div><div class="CodeMirror-gutters" style="display: none; height: 45px;"></div></div></div></pre><p><span>运行以下命令生成缓存</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang=""><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.2px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">yum clean all</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">yum makecache</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 45px;"></div><div class="CodeMirror-gutters" style="display: none; height: 45px;"></div></div></div></pre><p><span>除了网易之外，国内还有其他不错的 yum 源，比如中科大和搜狐。</span><br/><span>中科大的 yum 源，安装方法查看：</span><a href='https://lug.ustc.edu.cn/wiki/mirrors/help/centos' target='_blank' class='url'>https://lug.ustc.edu.cn/wiki/mirrors/help/centos</a><span></span><br/><span>sohu 的 yum 源安装方法查看: </span><a href='http://mirrors.sohu.com/help/centos.html' target='_blank' class='url'>http://mirrors.sohu.com/help/centos.html</a><span>    </span></p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p></div></div>

<script>(function(){var e=document.body.parentElement,t=[],n=null,i=document.body.classList.contains("typora-export-collapse-outline"),r=function(e,t,n){document.addEventListener(e,function(e){if(!e.defaultPrevented)for(var i=e.target;i&&i!=this;i=i.parentNode)if(i.matches(t)){!1===n.call(i,e)&&(e.preventDefault(),e.stopPropagation());break}},!1)};function o(){return e.scrollTop}r("click",".outline-expander",function(e){var t=this.closest(".outline-item-wrapper").classList;return t.contains("outline-item-open")?t.remove("outline-item-open"):t.add("outline-item-open"),d(),!1}),r("click",".outline-item",function(e){var t=this.querySelector(".outline-label");if(location.hash="#"+t.getAttribute("href"),i){var n=this.closest(".outline-item-wrapper").classList;n.contains("outline-item-open")||n.add("outline-item-open"),c(),n.add("outline-item-active")}});var a,s,l=function(){var e=o();n=null;for(var i=0;i<t.length&&t[i][1]-e<60;i++)n=t[i]},c=function(){document.querySelectorAll(".outline-item-active").forEach(e=>e.classList.remove("outline-item-active")),document.querySelectorAll(".outline-item-single.outline-item-open").forEach(e=>e.classList.remove("outline-item-open"))},d=function(){if(n){c();var e=document.querySelector('.outline-label[href="#'+(CSS.escape?CSS.escape(n[0]):n[0])+'"]');if(e)if(i){var t=e.closest(".outline-item-open>ul>.outline-item-wrapper");if(t)t.classList.add("outline-item-active");else{for(var r=(e=e.closest(".outline-item-wrapper")).parentElement.closest(".outline-item-wrapper");r;)r=(e=r).parentElement.closest(".outline-item-wrapper");e.classList.add("outline-item-active")}}else e.closest(".outline-item-wrapper").classList.add("outline-item-active")}};window.addEventListener("scroll",function(e){a&&clearTimeout(a),a=setTimeout(function(){l(),d()},300)});var u=function(){s=setTimeout(function(){!function(){t=[];var e=o();document.querySelector("#write").querySelectorAll("h1, h2, h3, h4, h5, h6").forEach(n=>{var i=n.getAttribute("id");t.push([i,e+n.getBoundingClientRect().y])})}(),l(),d()},300)};window.addEventListener("resize",function(e){s&&clearTimeout(s),u()}),u()})();</script></body>
</html>